package model.Board;

/**
 * Coordinates class that contains the row and column coordinates.
 * 
 * @author Peter-John Rowe
 *
 */
public class Coordinates {

	/**Row Coordinate*/
	private final int m_nRow;
	/**Column Coordinate*/
	private final int m_nColumn;
	
	/**
	 * Constructor
	 * 
	 * @param a_nRow - row coordinate
	 * @param a_nColumn - column coordinate
	 */
	public Coordinates(int a_nRow,int a_nColumn) {
		m_nRow = a_nRow;
		m_nColumn = a_nColumn;
	}
	
	/**
	 * Gets the row coordinate
	 * 
	 * @return m_nRow
	 */
	public int getRowCoordinate() {
		return m_nRow;
	}
	
	/**
	 * Gets the column coordinate
	 * 
	 * @return m_nColumn
	 */
	public int getColumnCoordinate() {
		return m_nColumn;
	}

	/**
	 * Checks to see if coordinates are equal.
	 * 
	 * @param a_oObject - object being compared
	 * @return bEqualsValue - checks to see if the value is 
	 */
	public boolean equals(Coordinates a_oObject) {
		boolean bEqualsValue;		
		if ( a_oObject == null ) {
			bEqualsValue = false;
		} else {
			Coordinates oObject = (Coordinates) a_oObject;
			bEqualsValue = m_nRow == oObject.getRowCoordinate() && 
							m_nColumn == oObject.getColumnCoordinate();
		}
		
		return bEqualsValue;
	}

	
} // Coordinates Class
